BM_CODE_ROOT = $(shell cd ../../../; pwd)
include $(BM_CODE_ROOT)/Rules.make

SRC += $(wildcard *.cpp)
OBJS := $(patsubst %.cpp, %.o, $(SRC))

LIBS += -lpthread

client = client
process_server = process_server
pre_process_server = pre_process_server
thread_server = thread_server
pre_thread_server = pre_thread_server
main_accept_thread_server = main_accept_thread_server

all : $(OBJS)  $(client) $(process_server) $(pre_process_server) $(thread_server) $(pre_thread_server) $(main_accept_thread_server)

$(client):
	$(CXX) $(CXXFLAGS) $(client).o cs_common.o  -o  $@ $^ $(INCDIR) $(LIBS)

$(process_server):
	$(CXX) $(CXXFLAGS) $(process_server).o  cs_common.o -o  $@ $^ $(INCDIR) $(LIBS)

$(pre_process_server):
	$(CXX) $(CXXFLAGS) $(pre_process_server).o  cs_common.o -o  $@ $^ $(INCDIR) $(LIBS)

$(thread_server):
	$(CXX) $(CXXFLAGS) $(thread_server).o  cs_common.o -o  $@ $^ $(INCDIR) $(LIBS)

$(pre_thread_server):
	$(CXX) $(CXXFLAGS) $(pre_thread_server).o  cs_common.o -o  $@ $^ $(INCDIR) $(LIBS)

$(main_accept_thread_server):
	$(CXX) $(CXXFLAGS) $(main_accept_thread_server).o  cs_common.o -o  $@ $^ $(INCDIR) $(LIBS)
clean:  
	rm $(OBJS) $(client)  $(process_server) $(pre_process_server) $(thread_server) $(pre_thread_server)  $(main_accept_thread_server) core* -f

